// 给时间类型挂载一个自定义函数
type shijiantype = string|number|null
function guazaiDate(){
    Date.prototype.toMyString = function(shijian:shijiantype,str=""):string{
        if(!shijian){
            return ""
        }
        let time = new Date(parseInt(shijian as string)).toLocaleString("zh", {
            year: 'numeric',
            month: 'numeric',
            day: 'numeric',
            hour12: false,
            hour: 'numeric',
            minute: 'numeric',
            second: 'numeric'
        })
        if(str){
            time = time.replace("/",str)
        }
        return time
    }
}



export default  {
    guazaiDate
}